﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        List<string> ff = new List<string> { "郭练成","魏帅","卢徵颐","肖高辉","李思思","单升","周旋坤","朱朝满","蒋豪怡","陈笑笛" };
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CheckBoxList1.Items.Count == 0)
            {
                for (int i = 0; i < 10; i++)
                {
                    CheckBoxList1.Items.Add(ff[i]);//添加候选人（候选人是我随便从点名册拿的）
                }
            }
            Label1.Text = " ";
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            for(int i = 0; i < CheckBoxList1.Items.Count; i++)
            {
                if (CheckBoxList1.Items[i].Selected)
                {
                    Label1.Text += " " + CheckBoxList1.Items[i].ToString();
                }
            }
        }
    }
}